package com.example.common.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
@Profile({"dev", "test"})
public class Knife4jConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("init demo api")
                        .version("1.0")
                        .description("example 项目")
                        .termsOfService("https://test.com")
                        .contact(new Contact().name("Tjatse").url("https://test.com").email("zhu930824@outlook.com"))
                );
    }

}